package #(package);


import #(modelPackageName);
import #(dtoPackageName)Dto;
import #(packageBase).dao.#(className);
import #(packageBase).service.#(className)Service;
import org.springframework.stereotype.Service;

import java.util.LinkedList;
/**
* #(className) 管理
* 描述：
* @Created by yufeng
*/
@Service
public class #(className)ServiceImpl implements #(className)Service {


    @Autowired
    #(className)Mapper #(classNameSmall)Mapper;
    @Autowired
    MissDataBiz missDataBiz;

    @Override
    @Transactional(rollbackFor = Exception.class)
    public int deleteByPrimaryKey(Long id) {
        #(className) #(classNameSmall) = selectByPrimaryKey(id);
        if (null == #(classNameSmall)) {
        return 0;
        }
        return updateByPrimaryKeySelective(#(classNameSmall));
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public int insertSelective(#(className) record) {
        missDataBiz.saveMissingData(record);
        record.setIsDelete(false);
        return #(classNameSmall)Mapper.insertSelective(record);
    }

    @Override
    public #(className) selectByPrimaryKey(Long id) {
        return #(classNameSmall)Mapper.selectByPrimaryKey(id);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public int updateByPrimaryKeySelective(#(className) record) {
        missDataBiz.editMissingData(record);
        return #(classNameSmall)Mapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public PageInfo<#(className)Data> selectListPage(#(className)QueryData #(classNameSmall)QueryData) {
        PageHelper.startPage(#(classNameSmall)QueryData.getPageNum(), #(classNameSmall)QueryData.getPageSize());
        List<#(className)Data> #(classNameSmall)s = #(classNameSmall)Mapper.selectListPage(#(classNameSmall)QueryData);
        PageInfo<#(className)Data> pageInfo = new PageInfo<>(#(classNameSmall)s);
        return pageInfo;
    }

}